package com.bizmerce.rnd.oms.codemng.service.impl;

import java.util.HashMap;

import org.springframework.stereotype.Repository;

import com.bizmerce.rnd.oms.codemng.service.CumulativeVO;

import egovframework.rte.psl.dataaccess.EgovAbstractDAO;

@Repository("cumulativeDAO")
public class CumulativeDAO  extends EgovAbstractDAO{

	/**
	 * 누적기준 적용여부
	 * @param id 
	 */
	public CumulativeVO selectCum(String id)  {
		HashMap<String, String> param = new HashMap<String, String>();
		param.put("AGREE_CD", id);
		return (CumulativeVO) getSqlMapClientTemplate().queryForObject("CodeMng.selectCum", param);
	}

	/**
	 * 누적기준 -저장
	 * @param id 
	 */
	public void updateCum(String id, boolean apply)  {
		HashMap<String, Object> param = new HashMap<String, Object>();
		param.put("AGREE_CD", id);
		param.put("APPL_YN", apply);
		getSqlMapClientTemplate().update("CodeMng.updateCum", param);
	}
}